<?
if (isset( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
	$im = $GLOBALS["HTTP_RAW_POST_DATA"];
	$file_name = md5(time());
	$fp = fopen($file_name . ".jpg", 'wb');
	fwrite($fp, $im);
	fclose($fp);
  $fp = fopen($file_name . ".txt", 'wb');
  fwrite($fp, print_r($_GET));
  fclose($fp);
	echo 'result=' . $file_name . '.jpg';
}
else {
	echo 'result=An error occured';
}
?>